package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.zzw.TEventManage;
import com.ruoyi.common.core.domain.zzw.TEventTrack;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TEventTrackMapper;
import com.ruoyi.system.service.ITEventTrackService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author xbx
 * @date 2023-10-20
 */
@Service
public class TEventTrackServiceImpl extends ServiceImpl<TEventTrackMapper, TEventTrack> implements ITEventTrackService {
    @Autowired
    private TEventTrackMapper tEventTrackMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param cId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public TEventTrack selectTEventTrackByCId(Long cId) {
        return tEventTrackMapper.selectTEventTrackByCId(cId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param tEventTrack 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<TEventTrack> selectTEventTrackList(TEventTrack tEventTrack) {
        return tEventTrackMapper.selectTEventTrackList(tEventTrack);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param tEventTrack 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertTEventTrack(TEventTrack tEventTrack) {
        return tEventTrackMapper.insertTEventTrack(tEventTrack);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param tEventTrack 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateTEventTrack(TEventTrack tEventTrack) {
        return tEventTrackMapper.updateTEventTrack(tEventTrack);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param cIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteTEventTrackByCIds(List<Long> cIds) {
        return tEventTrackMapper.deleteTEventTrackByCIds(cIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param cId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteTEventTrackByCId(Long cId) {
        return tEventTrackMapper.deleteTEventTrackByCId(cId);
    }

    @Override
    public List<TEventTrack> listByEventId(Long eventId) {
        QueryWrapper<TEventTrack> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(null != eventId, TEventTrack::getcEventId, eventId);
        return this.list(queryWrapper);
    }
}
